home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Collection of Tools & Utilities
/
Collection of Tools and Utilities.iso
/
bbsutil
/
dlx70bbs.zip
/
DLX70SRC.ZIP
/
SCRIPT1.PAS
< prev
next >
Wrap
Pascal/Delphi Source File
|
1994-01-26
|
23KB
|
545 lines
{$debug-}
{$line-}
{$include: 'types.int'}
{$include: 'globals.int'}
{$include: 'ident.int'}
{$include: 'utils.int'}
{$include: 'fs_pkg.int'}
{$include: 'database.int'}
{$include: 'load.int'}
{$include: 'sutils.int'}
{$include: 'script1.int'}
IMPLEMENTATION OF script1;
USES types,globals,ident,utils,fs_pkg,database,load,sutils;
{DLX Bulletin Board System V7.0
FREEWARE NOTICE
DLX V7.0 is placed in the public domain by its author, Richard Gillmann.
Anyone who wishes to may run the program, copy it, or modify it for
any purpose, including commercial gain.}
{***INTERFACE TO THE COM_PAX2 ASYNCHRONOUS COMMUNICATIONS PACKAGE***}
{$include: 'com_pax2.int'}
{***Interface to the assembler utilities packages***}
{$include: 'pasasm.int'}
{$include: 'newasm.int'}
procedure bbs1{consts s : lstring; var str : lstring};
var
i,j : integer;
next_state : task;
p : para;
c : char;
fl : boolean;
begin
next_state:=succ(q[wx].state);
case q[wx].state of
main_menu: prompt_with(main_menu_txt);
main_fork:
[next_state:=main_menu;
if time_check(true) then
[display(time_limit_txt); next_state:=snip]
else if str=null then
display(dunno_txt)
else if str='VERSION' then {version}
[p:=newpara('DLX 7.00');
w^[wx].output:=p; w^[wx].crud:=true; myid;
w^[wx].node_type:=nt_display; next_state:=main_menu]
{normal commands}
else if str.len=1 and then str[1]=mn[4][1] then {?}
display(main_menu_list_txt)
else if str.len=1 and then str[1]=mn[4][2] then {A}
[if q[wx].level>=priv_ans then
[display(answer_again_txt); next_state:=answer]
else
display(read_access_txt)]
else if str.len=1 and then str[1]=mn[4][3] {B} then
[if q[wx].level>=priv_br then
[q[wx].return_state:=main_menu;
display(browse_head_txt); next_state:=browse_prompt]
else
display(read_access_txt)]
else if str.len=1 and then str[1]=mn[4][4] then {C}
[display(lounge_header_txt); next_state:=chat_menu]
else if str.len=1 and then str[1]=mn[5][5] then {D}
[display(dbw_txt); next_state:=db1]
else if str.len=1 and then str[1]=mn[4][5] then {E}
[if fs_openr(wx,'EXPLAIN')=0 then
[q[wx].return_state:=main_menu; q[wx].bflag:=true;
next_state:=display_file]
else
[fs_close(wx); next_state:=main_menu]]
else if str.len=1 and then str[1]=mn[4][6] then {F}
display(facts_txt)
else if str.len=1 and then str[1]=mn[4][7] then {G}
[q[wx].flag:=true; {allow return to main menu}
next_state:=goodbye_menu]
else if str.len=1 and then str[1]=mn[4][8] then {L}
[display(libr_welcome_txt); next_state:=libr_menu]
else if str.len=1 and then str[1]=mn[4][9] {M} then
[if q[wx].level>=priv_ma then
[q[wx].return_state:=main_menu;
if business then
[q[wx].index:=1;
display(match_header_txt); next_state:=match_line]
else
[display(match_parameters_txt); next_state:=match]]
else
display(read_access_txt)]
else if str.len=1 and then str[1]=mn[4][10] then {N}
[if q[wx].level>=priv_bio then
[if essay<>nil then
[q[wx].return_state:=main_menu;
display(bio_header_txt); next_state:=bio]
else
next_state:=main_menu]
else
display(read_access_txt)]
else if str.len=1 and then str[1]=mn[5][6] then {O}
[if q[wx].level>=priv_order then
[if order<>nil then
[q[wx].return_state:=main_menu;
prompt_with(ordr_header_txt); next_state:=ordr]
else
next_state:=main_menu]
else
display(read_access_txt)]
else if str.len=1 and then str[1]=mn[4][11] then {P}
[if ivalue(q[wx].my.times_called)<many_calls
then [display(pubmail_header_txt); next_state:=pubmail1]
else [prompt_with(select_category_txt); next_state:=pubmail4]]
else if str.len=1 and then str[1]=mn[4][12] then {R}
[if q[wx].mbx_first=nil then
next_state:=msgs_4u
else
[q[wx].count:=ivalue(q[wx].my.mbx_count); q[wx].current_msg:=0;
display(msg_title_txt); next_state:=readmail_header]]
else if str.len=1 and then str[1]=mn[5][1] then {S}
[if q[wx].level>=priv_send then
[if q[wx].holding then
[if q[wx].hold_target=-1 then
display(hold_error_txt)
else
[q[wx].return_state:=main_menu;
q[wx].correspondent:=q[wx].hold_target;
display(send_menu_list_txt); next_state:=sendmail_menu]]
else
[q[wx].return_state:=main_menu; q[wx].flag:=true;
display(send_private_txt); next_state:=sendmail_prompt]]
else
display(read_access_txt)]
else if str.len=1 and then str[1]=mn[5][2] {U} then
[if q[wx].level>=priv_us then
[q[wx].index:=userlog_next; q[wx].count:=0;
display(userlog_head_txt); next_state:=userlog]
else
display(read_access_txt)]
else if str.len=1 and then str[1]=mn[5][3] then {W}
[q[wx].index:=number_of_lines; q[wx].return_state:=main_menu;
display(who_header_txt); next_state:=who]
else if str.len=1 and then str[1]=mn[5][4] {X}
and then q[wx].level>=priv_x then
[q[wx].cleanup:='X'; next_state:=cleanup1]
else if str.len>2 and then
str[1]=mn[7][2] {/} and then str[2]=mn[7][4] {P} then {/P}
SlashP(s,str)
else if eq(str,ss[40]) then {HELP}
[if fs_openr(wx,'HELP')=0 then
[q[wx].return_state:=main_menu; q[wx].bflag:=true;
next_state:=display_file]
else
[fs_close(wx); next_state:=main_menu]]
else if eq(str,ss[41]) then {NEWS}
[if fs_openr(wx,'NEWS')=0 then
[q[wx].return_state:=main_menu; q[wx].bflag:=true;
next_state:=display_file]
else
[fs_close(wx); next_state:=main_menu]]
else if eq(str,ss[42]) then {NOWRAP}
[w^[wx].wrapat:=79; setwrap(79)]
else if eq(str,ss[44]) then {NEWPASSWORD}
[prompt_with(enter_pw_txt); next_state:=newpass]
else if eq(str,ss[45]) or else eq(str,ss[46]) then {TIME, DATE}
display(date_time_txt)
else if eq(str,ss[47]) then {WRAP}
[w^[wx].wrapat:=wrap_column; setwrap(wrap_column)]
{sysop commands}
else if q[wx].level=9 and then str[1]='!' then begin
if str='!C' and then (not q[wx].holding) then
[q[wx].return_state:=main_menu; q[wx].flag:=false; {canned msg}
display(send_private_txt); next_state:=sendmail_prompt]
else if str='!D' then
[q[wx].return_state:=main_menu;
prompt_with(delete_user_txt); next_state:=delete_user]
else if str='!J' then
[prompt_with(send_junkmail_txt); next_state:=junk1]
else if str='!K' then
[prompt_with(kill_line_txt); next_state:=kill_line]
else if str='!L' then
[q[wx].return_state:=main_menu;
prompt_with(change_level_txt); next_state:=change_level]
else if str='!M' then
[q[wx].return_state:=main_menu;
prompt_with(change_mbx_txt); next_state:=change_mbx]
else if str='!N' then
[if allow_new
then [allow_new:=false; display(nonew1s_txt)]
else [allow_new:=true; display(new1s_txt)]]
else if str='!O' then
[q[wx].return_state:=main_menu;
prompt_with(delete_old_txt); next_state:=delete_old]
else if str='!R' then
[prompt_with(recycle_txt); next_state:=recycle]
else if str='!T' then
[q[wx].return_state:=main_menu;
prompt_with(reset_time_txt); next_state:=reset_time]
else if str='!UA' then
[prompt_with(unanswer_txt); next_state:=unans1]
else if str='!UD' then
[prompt_with(undel_user_txt); next_state:=undel_user]